var myvue = new Vue({
		el: "body",
		data: {
			name: "",
			sex: "",
			phone: "",
			headimg: "",
			nowname: "",
			nowsex: "",
			nowphone: "",
			curr: false
		},
		methods: {
			myma: function() {
				var curr = AV.User.current();
				if(curr) {
					makeCode(location.href);
				} else {
					location.href = "../init/init.html";
				}
			},
			mymain: function() {
				var curr = AV.User.current();
				if(curr) {
					location.href = "page4a.html";
				} else {
					location.href = "../init/init.html";
				}
			},
			xiugai: function() {
				var curr = AV.User.current();
				if(curr) {
					location.href = "page4b.html";
				} else {
					location.href = "../init/init.html";
				}
			}
		},
		created: function() {
			console.log("进入啊");
			//初始化
			var APP_ID = 'Wx3JTgmqBaARoWCaGI96AM9h-gzGzoHsz';
			var APP_KEY = 'TrVpB16Og6Yac9u3BoiUy4hT';
			AV.init({
				appId: APP_ID,
				appKey: APP_KEY
			});
			//判断是否登录
			var curr = AV.User.current();
			if(curr) {
				console.log(curr);
				this.name = curr.attributes.name;
				this.sex = curr.attributes.sex;
				this.phone = curr.attributes.telephone;
				this.headimg = curr.attributes.headimg;
				this.curr = true;
				console.log(this.headimg);
				console.log("欢迎" + curr.attributes.name + "的光临");
			} else {
				this.headimg = "img/468237371695478287a7eedf6d4960f5.jpg";
			}
		}
	})
	//二维码
function makeCode(text) {
	$("#doc-qrcode").empty().qrcode(text);
}